<template>
  <el-container id="home">
    <img src="../assets/express_logo.png" style="position: absolute;left: 37%; height: 200px;" alt="">
    <h1 style="position: absolute;left: 46%;top: 250px">你好,{{$route.query.type | showType($route.query.type)}}</h1>
    <el-main class="buttonContainer">
      <el-button type="primary" @click="sendClick">寄件</el-button >
      <el-button type="primary" @click="queryClick">查询</el-button>
    </el-main>
  </el-container>
</template>

<script>
export default {
  name: "Home",
  data() {
    return {
    }
  },
  filters: {
    showType(type) {
      if(type === 'normal' || type === 'customer') {
        return '普通用户';
      } else {
        return '管理员';
      }
    }
  },
  methods: {
    sendClick() {
      this.$router.push('/send');
    },
    queryClick() {
      this.$router.push('/query');
    }
  }
}
</script>

<style scoped>
#home {
  height: 100%;
  width: 100%;
  background-image:  url("../assets/bg.svg");
  background-repeat: no-repeat;
  background-size: cover;
}


.buttonContainer {
  position: absolute;
  top: 47%;
  left: 45%;
}
</style>
